<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1,minimum-scale=1,maximum-scale=1">
    <title>html5 webapp 基础组件</title>
    <style>
        body {
            margin: 0;
            padding: 0;
            background-color: #000;
            font-size: 12px;
        }
        .iphone {
            width: 340px;
            height: 540px;
            background-color: #fff;
            position: absolute;
            left: 50%;
            top: 50%;
            margin:-270px 0 0 -170px;
        }

    </style>
    <script src="../js/lib/jquery.js"></script>
    <script src = "../js/H5ComponentBase.js"></script>
    <link rel="stylesheet" href="../css/H5ComponentBase.css">
</head>
<body>
    <!--用于开发测试 H5ComponentBase 对象（基本图文组件）-->
    <div class="iphone">

    </div>

    <script>
        var cfg = {
            type  : 'base',
            bg    : '../images/p1_people.png ',
            width : 514,
            height: 306,
            css   : {
                bottom: 0,
                opacity:0,
            },
            animateIn: {bottom:80,opacity:1},
            animateOut:{bottom:0,opacity:0},
            center : true, //为true时居中且上面的css中的位置样式无效
        }
        var h5 = new H5ComponentBase('myBaseComponent',cfg);
        $('.iphone').append(h5);
        var leave = true;
        $('body').click(function () {
            leave = !leave;
            $('.h5_component').trigger(leave ? 'onLeave' : 'onLoad')
        })
    </script>


</body>

</html>